package com.sm.healthy.data.bean

import android.os.Parcelable
import androidx.room.Entity
import androidx.room.Index
import androidx.room.PrimaryKey
import com.sm.healthy.ext.getTimeFormat
import kotlinx.android.parcel.Parcelize
import java.util.*

/**
 * @description
 * @author csw
 * @date 2021-05-03
 */
@Parcelize
@Entity(tableName = "spo2Measure", indices = [Index(value = ["id"], unique = true)])
data class Spo2Entity(
    //序号
    @PrimaryKey(autoGenerate = false) var uid: Long,
    var id: String = Calendar.getInstance().timeInMillis.getTimeFormat("yyyy-MM-dd hh:mm:ss"),//测量时间
    var spo2Ave: Int = 0,//血氧饱和度
    var pulseRateAve: Int = 0,//血氧饱和度
    var levelSpo2: Int = 0,//0正常 1 偏低  2偏高
    var levelPulse: Int = 0,//0正常 1 偏低  2偏高
    var timeLong: Long = Calendar.getInstance().timeInMillis // 测量时长
) : Parcelable